<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>卖家登录 - 在线购物系统</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#FF7D00',
                        neutral: {
                            100: '#F5F7FA',
                            200: '#E5E6EB',
                            300: '#C9CDD4',
                            400: '#86909C',
                            500: '#4E5969',
                            600: '#272E3B',
                            700: '#1D2129',
                        }
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .btn-primary {
                @apply bg-primary text-white px-6 py-3 rounded-lg font-medium transition-all duration-300 hover:bg-primary/90 hover:shadow-md active:scale-95;
            }
            .form-input {
                @apply w-full px-4 py-3 border border-neutral-300 rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-primary outline-none transition-all;
            }
            .card-shadow {
                box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
            }
        }
    </style>
</head>
<body class="font-inter bg-gradient-to-br from-primary/5 to-primary/10 min-h-screen flex flex-col">
    <!-- 导航栏 -->
    <header class="bg-white shadow-sm">
        <div class="container mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between items-center h-16">
                <div class="flex items-center">
                    <a href="MainServlet?method=index" class="flex items-center space-x-2">
                        <i class="fa fa-shopping-bag text-2xl text-primary"></i>
                        <span class="text-xl font-bold text-neutral-700">ShopEase</span>
                    </a>
                </div>
                
                <div class="flex items-center">
                    <a href="MainServlet?method=index" class="text-neutral-700 hover:text-primary font-medium transition-colors mr-6">
                        返回首页
                    </a>
                </div>
            </div>
        </div>
    </header>

    <!-- 主要内容 -->
    <main class="flex-grow flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
        <div class="w-full max-w-md">
            <div class="bg-white rounded-2xl p-8 card-shadow transform transition-all duration-300 hover:shadow-lg">
                <div class="text-center mb-8">
                    <div class="w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fa fa-user-circle text-2xl text-primary"></i>
                    </div>
                    <h2 class="text-2xl font-bold text-neutral-700">卖家登录</h2>
                    <p class="text-neutral-500 mt-2">请输入您的账号信息登录卖家后台</p>
                </div>
                
                <% 
                    String error = request.getParameter("error");
                    if (error != null) {
                %>
                <div class="bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg mb-6">
                    <p><%= error %></p>
                </div>
                <% } %>
                
                <form action="SellerServlet?method=login" method="post">
                    <div class="mb-6">
                        <label for="username" class="block text-neutral-700 font-medium mb-2">用户名</label>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <i class="fa fa-user text-neutral-400"></i>
                            </div>
                            <input type="text" id="username" name="username" class="form-input pl-10" placeholder="请输入用户名" required>
                        </div>
                    </div>
                    
                    <div class="mb-6">
                        <div class="flex justify-between mb-2">
                            <label for="password" class="block text-neutral-700 font-medium">密码</label>
                            <a href="SellerServlet?method=toForgetPwd" class="text-sm text-primary hover:text-primary/80 transition-colors">忘记密码?</a>
                        </div>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <i class="fa fa-lock text-neutral-400"></i>
                            </div>
                            <input type="password" id="password" name="password" class="form-input pl-10" placeholder="请输入密码" required>
                            <button type="button" class="absolute inset-y-0 right-0 pr-3 flex items-center text-neutral-400 hover:text-neutral-700 transition-colors" id="toggle-password">
                                <i class="fa fa-eye-slash"></i>
                            </button>
                        </div>
                    </div>
                    
                    <div class="mb-6">
                        <button type="submit" class="btn-primary w-full flex items-center justify-center">
                            <i class="fa fa-sign-in mr-2"></i> 登录
                        </button>
                    </div>
                </form>
            </div>
            
            <div class="mt-6 text-center">
                <p class="text-neutral-500">
                    还没有账号? <a href="#" class="text-primary font-medium hover:underline">联系管理员注册</a>
                </p>
            </div>
        </div>
    </main>

    <!-- 页脚 -->
    <footer class="bg-white py-6 border-t border-neutral-200">
        <div class="container mx-auto px-4 sm:px-6 lg:px-8 text-center">
            <p class="text-neutral-500 text-sm">&copy; 2023 ShopEase 在线购物系统. 保留所有权利.</p>
        </div>
    </footer>

    <script>
        // 密码显示/隐藏切换
        document.getElementById('toggle-password').addEventListener('click', function() {
            const passwordInput = document.getElementById('password');
            const icon = this.querySelector('i');
            
            if (passwordInput.type === 'password') {
                passwordInput.type = 'text';
                icon.classList.remove('fa-eye-slash');
                icon.classList.add('fa-eye');
            } else {
                passwordInput.type = 'password';
                icon.classList.remove('fa-eye');
                icon.classList.add('fa-eye-slash');
            }
        });
        
        // 表单动画效果
        const inputs = document.querySelectorAll('.form-input');
        inputs.forEach(input => {
            input.addEventListener('focus', function() {
                this.parentElement.classList.add('scale-[1.01]');
                this.parentElement.style.transition = 'transform 0.3s ease';
            });
            
            input.addEventListener('blur', function() {
                this.parentElement.classList.remove('scale-[1.01]');
            });
        });
    </script>
</body>
</html>